/**
 * 
 */
package com.xxxx.game;

/**
 * @author HuXiaolong
 *
 */
public abstract class AnimationBasic implements IAnimation
{
	private IAnimation mNextAnimation = null;

	public IAnimation getNext()
	{
		return mNextAnimation;
	}

	public void append(IAnimation anim)
	{
		IAnimation next = this;
		while (next.getNext() != null)
		{
			next = next.getNext();
		}
		next.insert(anim);
	}

	public IAnimation insert(IAnimation anim)
	{
		if (anim != null)
		{
			if (mNextAnimation == null)
			{
				mNextAnimation = anim;
			}
			else
			{
				anim.append(mNextAnimation);
				mNextAnimation = anim;
			}

			return anim.getNext();
		}
		return null;
	}
}
